<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>std.perf</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "std.perf";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/std.perf.html" class="symbol">std.perf</a></h1>
  
<div class="summary">\file std/perf.d This file contains platform-independent performance classes</div>
<dl>
<dt class="decl">class <a class="symbol _class" name="PerformanceCounterScope" href="./htmlsrc/std.perf.html#L35" kind="class" beg="35" end="85">PerformanceCounterScope</a><span class="tparams">(T)</span>; <a title="Permalink to this symbol" href="#PerformanceCounterScope" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L35">#</a></dt>
<dd class="ddef">
<div class="summary">\brief Performance counter scope class generating template</div>
This template declares the class PerformanceCounterScope which manages a
 performance counter instance, scoping its measurement interval by virtue of
 its supporting the RAII mechanism.
<dl>
<dt class="decl"><a class="symbol _ctor" name="PerformanceCounterScope.this" href="./htmlsrc/std.perf.html#L44" kind="ctor" beg="44" end="54">this</a><span class="params">(T <em>counter</em>)</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounterScope.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L44">#</a></dt>
<dd class="ddef">
<div class="summary">\name Construction
 @{
 Constructs an instance of the PerformanceCounterScope using a reference 
 to the parameterising performance counter class, whose measurement is
 to be scoped. The measurement interval is commenced with a call to 
 <b>start()</b> on the managed counter instance.</div></dd>
<dt class="decl"><a class="symbol _dtor" name="PerformanceCounterScope.~this" href="./htmlsrc/std.perf.html#L57" kind="dtor" beg="57" end="60">~this</a>(); <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounterScope.~this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L57">#</a></dt>
<dd class="ddef">
<div class="summary">The measurement interval is completed with a call to <b>stop()</b> on the 
 managed counter instance.</div></dd>
<dt class="decl">void <a class="symbol _function" name="PerformanceCounterScope.stop" href="./htmlsrc/std.perf.html#L64" kind="function" beg="64" end="67">stop</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounterScope.stop" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L64">#</a></dt>
<dd class="ddef">
<div class="summary">Calls <b>stop()</b> on the managed counter instance, so that intermediate
 timings can be taken.</div></dd>
<dt class="decl">T <a class="symbol _function" name="PerformanceCounterScope.counter" href="./htmlsrc/std.perf.html#L70" kind="function" beg="70" end="73">counter</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounterScope.counter" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L70">#</a></dt>
<dd class="ddef">
<div class="summary">Returns a reference to the managed counter instance.</div></dd>
<dt class="decl">T <a class="symbol _variable" name="PerformanceCounterScope.m_counter" href="./htmlsrc/std.perf.html#L79" kind="variable" beg="79" end="79">m_counter</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounterScope.m_counter" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L79">#</a></dt>
<dd class="ddef">
<div class="summary">@}
 \name Members
 @{</div></dd>
<dt class="decl"><a class="symbol _ctor" name="PerformanceCounterScope.this:2" href="./htmlsrc/std.perf.html#L84" kind="ctor" beg="84" end="84">this</a><span class="params">(PerformanceCounterScope <em>rhs</em>)</span>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounterScope.this:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L84">#</a></dt>
<dd class="ddef">
<div class="summary">@}</div></dd></dl></dd>
<dt class="decl">struct <a class="symbol _struct" name="timeval" href="./htmlsrc/std.perf.html#L92" kind="struct" beg="92" end="96">timeval</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#timeval" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L92">#</a></dt>
<dd class="ddef">
<dl>
<dt class="decl">int <a class="symbol _variable" name="timeval.tv_sec" href="./htmlsrc/std.perf.html#L94" kind="variable" beg="94" end="94">tv_sec</a>; <a title="Permalink to this symbol" href="#timeval.tv_sec" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L94">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">int <a class="symbol _variable" name="timeval.tv_usec" href="./htmlsrc/std.perf.html#L95" kind="variable" beg="95" end="95">tv_usec</a>; <a title="Permalink to this symbol" href="#timeval.tv_usec" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L95">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">struct <a class="symbol _struct" name="timezone" href="./htmlsrc/std.perf.html#L97" kind="struct" beg="97" end="101">timezone</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#timezone" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L97">#</a></dt>
<dd class="ddef">
<dl>
<dt class="decl">int <a class="symbol _variable" name="timezone.tz_minuteswest" href="./htmlsrc/std.perf.html#L99" kind="variable" beg="99" end="99">tz_minuteswest</a>; <a title="Permalink to this symbol" href="#timezone.tz_minuteswest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L99">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">int <a class="symbol _variable" name="timezone.tz_dsttime" href="./htmlsrc/std.perf.html#L100" kind="variable" beg="100" end="100">tz_dsttime</a>; <a title="Permalink to this symbol" href="#timezone.tz_dsttime" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L100">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">void <a class="symbol _function" name="gettimeofday" href="./htmlsrc/std.perf.html#L102" kind="function" beg="102" end="102">gettimeofday</a><span class="params">(timeval * <em>tv</em>, timezone * <em>tz</em>)</span>; <span class="attrs">[<span class="prot">private</span>, <span class="linkg">extern(C)</span>]</span> <a title="Permalink to this symbol" href="#gettimeofday" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L102">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">class <a class="symbol _class" name="PerformanceCounter" href="./htmlsrc/std.perf.html#L114" kind="class" beg="114" end="208">PerformanceCounter</a>; <a title="Permalink to this symbol" href="#PerformanceCounter" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L114">#</a></dt>
<dd class="ddef">
<div class="summary">\brief A performance counter that uses the most accurate measurement APIs available on the host machine</div>
This class attempts to use the high performance hardware counter as its measurement resource, but failing 
 that it defaults to less accurate resources in order to guarantee that meaningful measurements are always
 available to application code
<p class="bl"/>
 \ingroup group_synsoft_linux_perf
<dl>
<dt class="decl">alias timeval <a class="symbol _alias" name="PerformanceCounter.epoch_type" href="./htmlsrc/std.perf.html#L119" kind="alias" beg="119" end="119">epoch_type</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.epoch_type" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L119">#</a></dt>
<dd class="ddef">
<div class="summary">\name Types
 @{</div></dd>
<dt class="decl">alias long <a class="symbol _alias" name="PerformanceCounter.interval_type" href="./htmlsrc/std.perf.html#L124" kind="alias" beg="124" end="124">interval_type</a>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.interval_type" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L124">#</a></dt>
<dd class="ddef">
<div class="summary">\brief The interval type</div>
The type of the interval measurement, a 64-bit signed integer</dd>
<dt class="decl">alias PerformanceCounterScope!(PerformanceCounter) <a class="symbol _alias" name="PerformanceCounter.scope_type" href="./htmlsrc/std.perf.html#L130" kind="alias" beg="130" end="130">scope_type</a>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.scope_type" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L130">#</a></dt>
<dd class="ddef">
<div class="summary">\brief The scope type</div>
The type with which instances of the counter class can be subject to the RAII mechanism in order
 to scope particular measurement intervals</dd>
<dt class="decl">void <a class="symbol _function" name="PerformanceCounter.start" href="./htmlsrc/std.perf.html#L139" kind="function" beg="139" end="144">start</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.start" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L139">#</a></dt>
<dd class="ddef">
<div class="summary">@}
 \name Operations
 @{
 \brief Starts measurement</div>
Begins the measurement period</dd>
<dt class="decl">void <a class="symbol _function" name="PerformanceCounter.stop" href="./htmlsrc/std.perf.html#L149" kind="function" beg="149" end="154">stop</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.stop" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L149">#</a></dt>
<dd class="ddef">
<div class="summary">\brief Ends measurement</div>
Ends the measurement period</dd>
<dt class="decl">interval_type <a class="symbol _function" name="PerformanceCounter.periodCount" href="./htmlsrc/std.perf.html#L163" kind="function" beg="163" end="166">periodCount</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.periodCount" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L163">#</a></dt>
<dd class="ddef">
<div class="summary">@}
 \name Attributes
 @{
 \brief The elapsed count in the measurement period</div>
This represents the extent, in machine-specific increments, of the measurement period</dd>
<dt class="decl">interval_type <a class="symbol _function" name="PerformanceCounter.seconds" href="./htmlsrc/std.perf.html#L171" kind="function" beg="171" end="177">seconds</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.seconds" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L171">#</a></dt>
<dd class="ddef">
<div class="summary">\brief The number of whole seconds in the measurement period</div>
This represents the extent, in whole seconds, of the measurement period</dd>
<dt class="decl">interval_type <a class="symbol _function" name="PerformanceCounter.milliseconds" href="./htmlsrc/std.perf.html#L182" kind="function" beg="182" end="188">milliseconds</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.milliseconds" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L182">#</a></dt>
<dd class="ddef">
<div class="summary">\brief The number of whole milliseconds in the measurement period</div>
This represents the extent, in whole milliseconds, of the measurement period</dd>
<dt class="decl">interval_type <a class="symbol _function" name="PerformanceCounter.microseconds" href="./htmlsrc/std.perf.html#L193" kind="function" beg="193" end="199">microseconds</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.microseconds" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L193">#</a></dt>
<dd class="ddef">
<div class="summary">\brief The number of whole microseconds in the measurement period</div>
This represents the extent, in whole microseconds, of the measurement period</dd>
<dt class="decl">epoch_type <a class="symbol _variable" name="PerformanceCounter.m_start" href="./htmlsrc/std.perf.html#L205" kind="variable" beg="205" end="205">m_start</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.m_start" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L205">#</a></dt>
<dd class="ddef">
<div class="summary">@}
 \name Members
 @{</div></dd>
<dt class="decl">epoch_type <a class="symbol _variable" name="PerformanceCounter.m_end" href="./htmlsrc/std.perf.html#L206" kind="variable" beg="206" end="206">m_end</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#PerformanceCounter.m_end" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L206">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl"><a class="symbol _unittest" name="unittest" href="./htmlsrc/std.perf.html#L210" kind="unittest" beg="210" end="236">unittest</a>; <a title="Permalink to this symbol" href="#unittest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.perf.html#L210">#</a></dt>
<dd class="ddef"></dd></dl>
</div>
<div id="footer">
  <p>Copyright © 1999-2008 by Digital Mars ®, All Rights Reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 03:40:09 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>